import request from "@/utils/request";

/**
 * 分页查询物品
 * @param param
 * @returns {AxiosPromise}
 */
export function page(param) {
    return request({
        url: '/lost-found-item/page',
        method: 'get',
        params: param
    })
}

/**
 * 物品详情
 * @param uuid
 * @returns {AxiosPromise}
 */
export function detail(uuid) {
    return request({
        url: '/lost-found-item/detail/' + uuid,
        method: 'get',
    })
}

/**
 * 审核未通过
 * @param param
 * @returns {AxiosPromise}
 */
export function noPass(param) {
    return request({
        url: '/lost-found-item/no-pass/' + param.uuid,
        method: 'put',
        data: param
    })
}

/**
 * 审核通过
 * @param param
 * @returns {AxiosPromise}
 */
export function pass(param) {
    return request({
        url: '/lost-found-item/pass/' + param.uuid,
        method: 'put',
        data: param
    })
}

/**
 * 发布物品
 * @param uuid
 * @returns {AxiosPromise}
 */
export function publish(uuid) {
    return request({
        url: '/lost-found-item/publish/' + uuid,
        method: 'put',
    })
}

/**
 * 撤回物品
 * @param uuid
 * @returns {AxiosPromise}
 */
export function revoke(uuid) {
    return request({
        url: '/lost-found-item/revoke/' + uuid,
        method: 'put',
    })
}

/**
 * 删除物品
 * @param uuid
 * @returns {AxiosPromise}
 */
export function deleted(uuid) {
    return request({
        url: '/lost-found-item/delete/' + uuid,
        method: 'delete'
    })
}

/**
 * 物品导出
 * @returns {AxiosPromise}
 * @param param
 */
export function exportLostFoundItem(param) {
    return request({
        url: '/lost-found-item/export',
        method: 'post',
        params: param,
        responseType: 'blob'
    })
}

/**
 * 批量撤回
 * @returns {AxiosPromise}
 * @param param
 */
export function batchRevoke(param) {
    return request({
        url: '/lost-found-item/batch-revoke',
        method: 'put',
        data: param
    })
}

/**
 * 批量发布
 * @returns {AxiosPromise}
 * @param param
 */
export function batchPublish(param) {
    return request({
        url: '/lost-found-item/batch-publish',
        method: 'put',
        data: param
    })
}

/**
 * 批量删除
 * @returns {AxiosPromise}
 * @param param
 */
export function batchDelete(param) {
    return request({
        url: '/lost-found-item/batch-delete',
        method: 'delete',
        data: param
    })
}